package com.ideal.manage.esms.repository.project;

import com.ideal.manage.esms.bean.project.EquipmentManage;
import com.ideal.manage.esms.bean.project.EquipmentMessageConf;
import com.ideal.manage.esms.bean.project.EquipmentTemperatureConf;
import com.ideal.manage.esms.repository.framework.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created By Dai On 2018/4/25
 * Remark: 工程配置 - 对象管理 - 设备管理 - 报文数据 Repository
 */
public interface EquipmentMessageConfRepository extends BaseRepository<EquipmentMessageConf, String> {

    /**
     * 根据设备id查找所有的报文数据
     * @param id
     * @return
     */
    @Query("select e from EquipmentMessageConf e where e.equipment.id=?1")
    List<EquipmentMessageConf> findByEquipmentId(String id);

    /**
     * 根据设备查找到所有的报文数据
     * @param equipmentManages
     * @return
     */
    @Query("select e from EquipmentMessageConf e where e.equipment in ?1")
    List<EquipmentMessageConf> findByEquipmentList(List<EquipmentManage> equipmentManages);
}
